import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.Graphics;
import java.awt.Graphics2D;

/// A screen contains a background image, some text labels, and clickable areas
public class Screen
{
	protected BufferedImage bg; 			// Background image
	private ArrayList<Hotspot> hotspots;	// List of hotspots
	private ArrayList<Label> labels;		// List of labels
	
	private int xpos, ypos;
	
	public Screen(String filename)
	{
		hotspots = new ArrayList<Hotspot>();
		labels = new ArrayList<Label>();
		xpos = 0;
		ypos = 0;
		
		try
		{
			bg = ImageIO.read(new File(filename));
		}
		catch (IOException e)
		{
			System.err.println("Error loading file: " + filename);
		}
	}
	
	public ArrayList<Hotspot> getHotspots()
	{
		return hotspots;
	}
	
	public void addHotspot(Hotspot h)
	{
		hotspots.add(h);
	}
	
	public ArrayList<Label> getLabels()
	{
		return labels;
	}
	
	public void addLabel(Label l)
	{
		labels.add(l);
	}
	
	public BufferedImage getBackground()
	{
		return bg;
	}
	
	public void draw(Graphics g)
	{
		// Default draw method
		g.drawImage(bg, xpos, ypos, null);
	}
	
	public void checkClick(int x, int y)
	{
		// NOP
	}
	
	public void setPosition(int x, int y)
	{
		xpos = x;
		ypos = y;
	}
}